HomeView = {
	ctrl : HomeController,

	createHotBooksNode : function(arrHotBooks) {
		// Declare HotBooks
		var key = "home";
		addActive(key);
		var rootNodeHotBooks = $id("itemsHotBook");
		var hotBooks = null;
		var nodeItem = null;
		var nodeImg = null;
		var nodeItembot = null;
		var nodeName = null;
		var nodePrice = null;
		var lengthListHotBook = arrHotBooks.length;

		// Delete child node
		rootNodeHotBooks.innerHTML = "";

		//Set node Hotbooks
		for (var i = 0; i < lengthListHotBook; i++) {
			hotBooks = arrHotBooks[i];

			nodeItem = createNode("a");
			nodeItem.addClass("item");
			nodeItem.setAttribute("href", "#");
            nodeItem.setAttribute("id", hotBooks.BookId);
			nodeItem.addEventListener("click", getProductDetail,false); 

			nodeImg = createNode("img");
			nodeImg.addClass("item-img");
			nodeImg.src=hotBooks.Pic;

			nodeItembot = createDiv();
			nodeItembot.addClass("item-bot");

			nodeName = createDiv();
			nodeName.addClass("item-name");
			nodeName.setText(hotBooks.Name);

			nodePrice = createDiv();
			nodePrice.addClass("item-price");
			nodePrice.setText(hotBooks.Price);

			rootNodeHotBooks.appendChild(nodeItem);

			nodeItem.appendChild(nodeImg);
			nodeItem.appendChild(nodeItembot);

			nodeItembot.appendChild(nodeName);
			nodeItembot.appendChild(nodePrice);
		}
	},

    updateView: function(){
        this.createHotBooksNode(this.ctrl.model.HotBooks);
    }
}; 